package com.jzo2o.customer.controller.worker;


import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.model.dto.response.BankAccountResDTO;
import com.jzo2o.customer.model.dto.response.BooleanResDTO;
import com.jzo2o.customer.service.IWorkerBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * 评价相关接口
 *
 * @author itcast
 * @create 2023/9/11 16:14
 **/
@RestController("workerBankAccountController")
@RequestMapping("/worker/bank-account")
@Api(tags = "服务端 - 银行账户相关接口")
public class BankAccountController {

    @Resource
    private IWorkerBankAccountService bankAccountService;

    @PostMapping
    @ApiOperation("新增银行账户")
    public void addBankAccount(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO){

        bankAccountService.addOrUpdate(bankAccountUpsertReqDTO);
        System.out.println("bankAccountUpsertReqDTO =======================================   "
                  + bankAccountUpsertReqDTO.getId());
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation("获取用户的银行账户")
    public BankAccountResDTO getBankAccount(){
        BankAccountResDTO bankAccountResDTO = bankAccountService.getBankAccount();
        return bankAccountResDTO;
    }


}
